﻿<%@ Page Title="تقرير المسئول الشهري" Language="C#" MasterPageFile="~/MasterPages/Report.Master"
    AutoEventWireup="true" CodeBehind="MonthlyResponsibleReport.aspx.cs" Inherits="Pap.Web.Modules.Reports.Views.MonthlyResponsibleReport" %>

<%@ MasterType VirtualPath="~/MasterPages/Report.Master" %>

<asp:Content ContentPlaceHolderID="ReportParamsPlaceHolder" runat="server">
    <ext:Store ID="strCommittee" runat="server">
        <Reader>
            <ext:JsonReader ReaderID="CommitteeID">
                <Fields>
                    <ext:RecordField Name="CommitteeID" Mapping="CommitteeID" />
                    <ext:RecordField Name="CommitteeName" Mapping="CommitteeName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store ID="strUsers" runat="server">
        <Reader>
            <ext:JsonReader ReaderID="UserID">
                <Fields>
                    <ext:RecordField Name="UserID" />
                    <ext:RecordField Name="DisplayName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="strReport">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="ExecutionDate" />
                    <ext:RecordField Name="CheckDate" />
                    <ext:RecordField Name="CheckNumber" />
                    <ext:RecordField Name="LoanPaymentMethodName" />
                    <ext:RecordField Name="TotalLoanAmout" />
                    <ext:RecordField Name="Profit" />
                    <ext:RecordField Name="InstallmentsCount" />
                    <ext:RecordField Name="LoanAmount" />  
                    <ext:RecordField Name="Stage" />
                    <ext:RecordField Name="IsLoanProjectExist" />
                    <ext:RecordField Name="LoanTypeName" />
                    <ext:RecordField Name="Gender" />
                    <ext:RecordField Name="CustomerName" />
                    <ext:RecordField Name="LoanNumber" />
                    <ext:RecordField Name="BoardNumber" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:FormLayout ID="FormLayout1" runat="server">
        <ext:Anchor Horizontal="95%">
            <ext:ComboBox runat="server" StoreID="strCommittee" ID="ddlCommittee" DisplayField="CommitteeName"
                ValueField="CommitteeID" TypeAhead="true" Editable="true" FieldLabel="الجمعية"
                AllowBlank="false">
                <AjaxEvents>
                    <Select OnEvent="ddlCommittee_SelectedIndexChanged">
                        <EventMask ShowMask="true" />
                    </Select>
                </AjaxEvents>
            </ext:ComboBox>
        </ext:Anchor>
        <ext:Anchor Horizontal="95%">
            <ext:ComboBox ID="ddlUsers" StoreID="strUsers" runat="server" AllowBlank="false"
                FieldLabel="اسم المستخدم" DisplayField="DisplayName" ValueField="UserID" TypeAhead="true"
                Editable="true">
            </ext:ComboBox>
        </ext:Anchor>
        <ext:Anchor Horizontal="95%">
            <ext:MultiField runat="server" FieldLabel="تاريخ">
                <Fields>
                    <ext:Label runat="server" Text="من:">
                    </ext:Label>
                    <ext:DateField runat="server" ID="dtFromDate" AllowBlank="false" />
                    <ext:Label ID="Label1" runat="server" Text="الى:">
                    </ext:Label>
                    <ext:DateField runat="server" ID="dtToDate" AllowBlank="false" />
                </Fields>
            </ext:MultiField>
        </ext:Anchor>
    </ext:FormLayout>
</asp:Content>
<asp:Content ContentPlaceHolderID="ReportBodyPlaceHolder" runat="server">
    <div class="r-container">
        <header>
            <div class="logo">
                <asp:Image runat="server" ImageUrl="~/Assets/Images/PAPLogo.jpg" />
            </div>
            <div class="title">
                <%= this.Page.Title %>
            </div>
        </header>
        <div>
            
            <ext:DataView runat="server" StoreID="strReport" SingleSelect="true" ItemSelector="tr.row" EmptyText="<div class='x-r-emptyText'>No Data To Display</div>">
                <Template>
                    <html>
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <th>
                                    Execution Date
                                </th>
                                <th>
                                    Check Date
                                </th>
                                <th>
                                    Check Number
                                </th>
                                <th>
                                    Payment Method
                                </th>
                                <th>
                                    Total
                                </th>
                                <th>
                                    Profit
                                </th>
                                <th>
                                    Installments
                                </th>
                                <th>
                                    Original Amount
                                </th>
                                <th>
                                    Stage
                                </th>
                                <th>
                                    Status
                                </th>
                                <th>
                                    Project Type
                                </th>
                                <th>
                                    Gender
                                </th>
                                <th>
                                    Customer Name
                                </th>
                                <th>
                                 Loan Number
                                </th>
                                <th>
                                    Board Number
                                </th>
                            </tr>
                            <tpl for=".">
                                <tr class="row">
                                    <td>
                                        {[fm.date(values.ExecutionDate,"d/m/y")]}
                                    </td>
                                    <td>
                                        {[fm.date(values.CheckDate,"d/m/y")]}
                                    </td>
                                    <td align="center">
                                        {CheckNumber}
                                    </td>
                                    <td>
                                        {LoanPaymentMethodName}
                                    </td>
                                    <td align="center">
                                        {values.TotalLoanAmout}
                                    </td>
                                    <td align="center">
                                        {values.Profit}
                                    </td>
                                    <td>
                                        {InstallmentsCount}
                                    </td>
                                    <td align="center">
                                        {values.LoanAmount}
                                    </td>
                                    <td>
                                        {Stage}
                                    </td>
                                    <td>
                                        <tpl if="IsLoanProjectExist">
                                            New
                                        </tpl>
                                        <tpl if="!IsLoanProjectExist">
                                            Renew
                                        </tpl>
                                    </td>
                                    <td>
                                        {LoanTypeName}
                                    </td>
                                    <td>
                                        {Gender}
                                    </td>
                                    <td>
                                        {CustomerName}
                                    </td>
                                    <td>
                                        {LoanNumber}
                                    </td>
                                    <td>
                                        {BoardNumber}
                                    </td>
                                </tr>
                            </tpl>
                        </table>
                    </html>
                </Template>
            </ext:DataView>
        </div>
        <footer>
        </footer>
    </div>
</asp:Content>
